<template>
	<view>
		<web-view :src="effectiveUrl" @message="handleMessage"></web-view>
	</view>
</template>

<script>
	export default {
		props: {
			initialUrl: { // 使用不同的prop名称
				type: String,
				default: ''
			}
		},
		data() {
			return {
				loadding: true,
				dynamicUrl: ''
			}
		},
		onLoad(e) {
			this.dynamicUrl = e.url
		},
		computed: {
			effectiveUrl() {
				return this.dynamicUrl || this.initialUrl
			}
		},
		methods: {
			handleMessage(e) {
				console.log(e)
			}
		}
	}
</script>

<style>

</style>